import Vue from "vue";
import App from "./App.vue"; //最好加上./同级表达，不然有时找不到
import VueRouter from "vue-router";
Vue.use (VueRouter);
//mint-ui的使用(第三方)
import mintui from "mint-ui";
Vue.use(mintui);
import "mint-ui/lib/style.min.css";  //这个路径
//mui 的使用
import "../statics/mui/css/mui.css" ;
//导入公共样式
//导入各个路由
import "../statics/css/site.css"
import home from "./component/home.vue"; 
import email from "./component/email.vue";
import shopCar from "./component/shopCar.vue"
import set from "./component/set.vue";
//导入ajax请求(第三方插件)
import vueResource from "vue-resource";
Vue.use(vueResource);

import newslist from "./component/news/newslist.vue";
//导入日期格式化工具
import moment from "moment"; //自定义的对象名最好与它的
Vue.use(moment);
Vue.filter("datefmt",function(input,fmtstring){
    return moment(input).format(fmtstring);
})
//导入newsinfo页面组件
import newsinfo from "./component/news/newsinfo.vue"
 
//导入公共功能common.js减少代码重复
import common from "./kits/common.js"; //本身已经把该组件当对象引入
Vue.prototype.$common=common;
//导入图片列表页photolist
import photoList from "./component/photo/photolist.vue"
import photoinfo from "./component/photo/photoinfo.vue"
//导入预览插件
import VuePreview from 'vue-preview'
Vue.use(VuePreview)
//导入商品列表
import goodslist from "./component/goods/goodslist.vue"
import goodsinfo from "./component/goods/goodsinfo.vue"
//引入商品图文详情即评论
import getdesc from "./component/goods/getdesc.vue"
import procomment from "./component/subcom/comment.vue"
//引入购物车组件
import car from "./component/shopCar/car.vue"
var router1=new VueRouter({
    routes:[
        {
            path: "/",
            redirect: "/home"
        },
        {
            path: "/home",
            component: home
        },
        {
            path: "/email",
            component: email
        },
        {
            path: "/shopCar",
            component: shopCar
        },
        {
            path: "/set",
            component: set
        },{
            path: "/news/newslist",
            component: newslist
        },
        {
            path :"/news/newsinfo/:id",
            component: newsinfo
        },
        {
            path: "/photo/photoList",
            component: photoList
        },
        {
            path: "/photo/photoinfo/:id",
            component: photoinfo
        },
        {
            path: "/goods/goodslist",
            component: goodslist
        },
        {
            path: "/goods/goodsinfo/:id",
            component: goodsinfo
        },
        {
            path: "/goods/getdesc/:id",
            component: getdesc
        },
        {
            path: "/subcom/comment/:id",
            component: procomment
        },
        {
            path: "/shopCar/car",
            component: car
        }
    ],
    linkActiveClass: "mui-active",
})
new Vue({
    el: "#app",
    
    /* render:function(create){return create(App)} */ //es5的
    render:c=>c(App),
    router: router1
})